# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: liara <liara@archlinux.email>

pkgname=python-shodan
pkgver=1.28.0
pkgrel=2
pkgdesc='The official Python library and CLI for Shodan'
url='https://shodan.readthedocs.io/'
license=('MIT')
arch=('any')
depends=(
  'python'
  'python-click'
  'python-click-plugins'
  'python-colorama'
  'python-xlsxwriter'
  'python-requests'
  'python-setuptools'
)
makedepends=('git')
_commit='7d043d74735cfaf0b0b5dc8fbc81922ba117dfea'
source=("$pkgname::git+https://github.com/achillean/shodan-python.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python setup.py build
}

package() {
  cd "$pkgname"

  python setup.py install --root="$pkgdir" --optimize=1 --skip-build

  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
